<!-- Nav -->
<widget tag="div">
    <php>$fullscreen=empty($widget['vars']['fullscreen'])?'':'g-0';</php>
    <div class="container-fluid {$fullscreen}">
        <div id="mapCanvas{$_widget_id}" class="map-canvas no-margin" style="height: 450px;">
            <php>
                $company_location=empty($widget['vars']['company_location'])?'121.449222,31.193348':$widget['vars']['company_location'];
                $company_location=explode(',',$company_location);
                $company_location_lng=$company_location[0];
                $company_location_lat=$company_location[1];
            </php>
            <script type="text/javascript">
                var map   = new BMap.Map("mapCanvas{$_widget_id}"); // 创建Map实例
                var point = new BMap.Point("{$company_location_lng}", "{$company_location_lat}"); // 创建点坐标
                map.centerAndZoom(point, 15); // 初始化地图,设置中心点坐标和地图级别。
                //map.enableScrollWheelZoom(); //启用滚轮放大缩小
                //添加缩放控件
                map.addControl(new BMap.NavigationControl());
                map.addControl(new BMap.ScaleControl());
                map.addControl(new BMap.OverviewMapControl());

                var marker = new BMap.Marker(point); // 创建标注
                map.addOverlay(marker); // 将标注添加到地图中
                var infoWindow = new BMap.InfoWindow("{$widget.vars.baidu_map_info_window_text|htmlspecialchars_decode|default=''}"); // 创建信息窗口对象
                marker.openInfoWindow(infoWindow);
            </script>
        </div>
        <div>{$widget['vars']['baidu_map_info_window_rich_text']|default=''}</div>
        <hr>
        <div>{$widget['vars']['baidu_map_info_window_rich_text2']|default=''}</div>
    </div>
</widget>
